﻿using FreeSql.DataAnnotations;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Threading.Tasks;

namespace NoSqlTest.Model
{
    /// <summary>
    /// 课程
    /// </summary>
    public class Course
    {
        [FreeSql.DataAnnotations.Column(IsIdentity = true, IsPrimary = true)]//FreeSql
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true)]//Sugar
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]  //Ef设置自增(int类型默认自增)
        public int Id { get; set; }
        public string Name { get; set; }
        public virtual string Teacher { get; set; }
        [SugarColumn(IsIgnore = true)]
        public virtual ICollection<MiddleClassCourse> ClassStudents { get; set; }//班级学生
        [SugarColumn(IsIgnore = true)]
        public virtual ICollection<MiddleStudentCourse> Students { get; set; }//选修学生
    }
}
